#include <stdio.h>

#define ARRAY_LENGTH 200

int main()
{
    int case_num, book_num;
    while (scanf("%d %d", &case_num, &book_num) != EOF) {
        int book_list[ARRAY_LENGTH] = {0};
        int case_list[ARRAY_LENGTH] = {0};

        int temp_book;
        for (int i = 0; i < case_num; i++) {
            scanf(" %d", &temp_book);
            book_list[temp_book - 1]++;
            case_list[i] = temp_book;
        }

        int temp_case;
        for (int i = 0; i < case_num; i++) {
            temp_case = case_list[i];
            if (book_list[temp_case - 1] > 1)
                printf("%d\n", book_list[temp_case - 1] - 1);
            else
                printf("BeiJu\n");
        }
    }
}